package org.base.oj.domain.enumEntity;

public enum QuestionEnum {
    SELECT("选择题",0),
    JUDGE("判断题",1),
    MULTI_SELECT("多选题",2),
    FILL("填空题",3),
    PROGRAM("编程题",4),
    READ("阅读题",5);


    private final String typeName;
    private final Integer type;
    QuestionEnum(String typeName, Integer type){
        this.typeName = typeName;
        this.type = type;
    }
    public static QuestionEnum getItem(String typeName){
        for(QuestionEnum item : QuestionEnum.values()){
            if(item.typeName.equals(typeName)){
                return item;
            }
        }
        return null;
    }
    public static QuestionEnum getItem(Integer type){
        for(QuestionEnum item : QuestionEnum.values()){
            if(item.type.equals(type)){
                return item;
            }
        }
        return null;
    }
    public String getTypeName() {
        return typeName;
    }
    public Integer getType() {
        return type;
    }
}
